Adding discord rich presence support for Windows64 (Early)#968
Adding discord rich presence support for Windows64 (Early)#968acth2 wants to merge 2 commits intosmartcmd:mainfrom
Conversation
|
would it be better to hook directly into the localised strings? |
|
Obviously this wont be a drop in replacement but just an example, static std::string s_detailsUtf8;
static std::string s_stateUtf8;
s_detailsUtf8 = app.GetString(IDS_DISCORD_DETAILS_PLAYING_LCE);
discordPresence.details = s_detailsUtf8.c_str();
switch (iVal) {
case CONTEXT_GAME_STATE_NETHER:
s_stateUtf8 = app.GetString(IDS_DISCORD_STATE_NETHER);
break;
...
default:
s_stateUtf8 = app.GetString(IDS_DISCORD_STATE_SURVIVING);
break;
}
discordPresence.state = s_stateUtf8.c_str();
Discord_UpdatePresence(&discordPresence); |
thx i'll do it now |
e42a1f8 to
2d246ed
Compare
It's done thx for the example btw! |
I am a little late to the party but this is more like what I proposed initially since I noticed the strings in the code while digging around. |
|
Could this code be placed under a definition, please? |
yep i w as thinking about doing that |
34b76e6 to
fadef78
Compare
Cleaning PR Finishing rich presence core and Cleaning Removed Minecraft.Client/Minecraft.Client.vcxproj
ca3a74f to
ef3c3e9
Compare
Description
Reintroducing the Discord rich presence system, this idea come from #954
Changes
Previous Behavior
There were the functions for rich presence but no code inside of them: the code is still in an very early state but it works!

Root Cause
I needed to recode the discord rich presence but the system that tracks the players action and that permit me to modify what the rich presence says was already coded!
New Behavior
in Minecraft:Init i call ProfileManager.RichPresenceInit(...) and in Minecraft::tick i call player->updateRichPresence(); to constantly update the rich presence
NEW: I now use the Minecraft.Client/Windows64Media/loc/stringsRichPresence.xml file that contains the rich presence text (thanks to eff3ry for pointing that)
Fix Implementation
Previously it looked like this:

void C_4JProfile::RichPresenceInit(int iPresenceCount, int iContextCount) {}void C_4JProfile::SetRichPresenceContextValue(int iPad, int iContextID, int iVal) {}i just called discord-rpc.h and followed instructions to make a rich presence from there:
It works but its ugly for now!
AI Use Disclosure
nop
Related Issues